package com.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.MessageChannel;
import org.springframework.integration.support.MessageBuilder;


import java.util.UUID;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 05-06-18:49
 */

@EnableBinding(Source.class)
public class ProviderService {

    @Autowired
    private MessageChannel output ;

    public String send(){
        String serial = UUID.randomUUID().toString();
        this.output.send(MessageBuilder.withPayload(serial).build());
        return serial ;
    }
}
